package com.joysuch.wwyt.mh.enums;

/**
 * @Author ZhaoQiuWei
 * @Date 2022/5/19 10:50
 */
public enum MhMajorHazardCheckUserEnum {

    RESPONSIBLE_USER(0, "主要负责人"),
    TECHNOLOGY_USER(1, "技术负责人"),
    OPERATION_USER(2, "操作负责人");

    private Integer code;
    private String name;

    MhMajorHazardCheckUserEnum(Integer code, String name) {
        this.code = code;
        this.name = name;
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }


    public static String getNameByCode(Integer code) {
        for (MhMajorHazardCheckUserEnum e : MhMajorHazardCheckUserEnum.values()) {
            if (code.equals(e.getCode())) {
                return e.name;
            }
        }
        return null;
    }
}
